package com.fbty.mt.service.impl;

import java.util.List;

import com.fbty.mt.dao.PriceDao;
import com.fbty.mt.domain.Price;
import com.fbty.mt.service.PriceService;

public class PriceServiceImpl implements PriceService {
	private PriceDao priceDao;
	
	@SuppressWarnings("unchecked")
	@Override
	public List<Price> queryPrices() {
		return priceDao.find("from Price order by id");
	}

	public void setPriceDao(PriceDao priceDao) {
		this.priceDao = priceDao;
	}

	@Override
	public Price findPriceById(int id) {
		
		return priceDao.get(id);
	}

	@Override
	public void savePrice(Price  price) {
		
		priceDao.getHibernateTemplate().saveOrUpdate(price);
	}

	@Override
	public void deletePrice(int id) {
		priceDao.removeById(id);
	}

	
	
	
	

}
